@extends('Admin.base')
@section('css')
@endsection
@section('content')
    <div class="layui-card">
        <div class="layui-card-header layuiadmin-card-header-auto">
            <fieldset class="layui-elem-field layui-field-title">
                <legend>编辑</legend>
            </fieldset>
        </div>
        <div class="layui-card-body">
            <form class="layui-form" id="layui-form" action="{{route('offer.update',['id' => $data->id])}}"
                  method="post">
                @include('Admin.offer._form')
            </form>
        </div>
    </div>
@endsection
@section('script')
    <script src="/js/ajax.js"></script>
    <script>
        layui.use(['laydate', 'form'], function () {
            var form = layui.form,
                laydate = layui.laydate;
            //开启公历节日
            laydate.render({
                elem: '#test17'
                , calendar: true
            });
            laydate.render({
                elem: '#test18'
                , calendar: true
            });

            if ($("input[name='scope']:checked").val() == 2)  {
                $(".count").show();
            }else{
                $(".count").hide()
            }
            form.on('radio(radio)', function (data) {
                if (data.value == 2)  {
                    $(".count").show();
                }else{
                    $(".count").hide()
                }
                form.render();
            });
            form.render();
        });

    </script>
@endsection
